import request from '@/utils/request'

// 查询产品代码列表
export function listProjectCodeNo(query) {
  return request({
    url: '/product/projectCodeNo/list',
    method: 'get',
    params: query
  })
}

// 查询产品代码详细
export function getProjectCodeNo(projectCodeNoId) {
  return request({
    url: '/product/projectCodeNo/' + projectCodeNoId,
    method: 'get'
  })
}

// 新增产品代码
export function addProjectCodeNo(data) {
  return request({
    url: '/product/projectCodeNo',
    method: 'post',
    data: data
  })
}

// 修改产品代码
export function updateProjectCodeNo(data) {
  return request({
    url: '/product/projectCodeNo',
    method: 'put',
    data: data
  })
}

// 删除产品代码
export function delProjectCodeNo(projectCodeNoId) {
  return request({
    url: '/product/projectCodeNo/' + projectCodeNoId,
    method: 'delete'
  })
}

// 导出产品代码
export function exportProjectCodeNo(query) {
  return request({
    url: '/product/projectCodeNo/export',
    method: 'get',
    params: query
  })
}

// 通过机型和产品ID查询产品代码
export function getProjectCodeNoByMachineTypeAndProjectId(query) {
  return request({
    url: '/product/projectCodeNo/getByMachineTypeAndProjectId' ,
    method: 'get',
    params: query
  })
}
